package com.czk.classreader;

import com.czk.utils.FileUtil;
import org.objectweb.asm.ClassReader;

import java.util.Arrays;

/**
 *
 * @Author:ChenZhangKun
 * @Date: 2021/8/1 15:44
 */
public class ClassReader_1 {
    public static void main(String[] args) {
        String filePath = "F:\\IdeaProjects\\asm\\target\\classes\\com\\czk\\pojo\\Request.class";
        byte[] bytes = FileUtil.readBytes(filePath);
        ClassReader cr = new ClassReader(bytes);
        // 调用ge方法
        int access = cr.getAccess();
        System.out.println("access=" + access);
        String className = cr.getClassName();
        System.out.println("className=" + className);
        String superName = cr.getSuperName();
        System.out.println("superName=" + superName);
        String[] interfaces = cr.getInterfaces();
        System.out.println("interface=" + Arrays.toString(interfaces));

    }
}
